<?php
defined('SWAP_ROOT') or die('非法操作');
//---------------------------------插件配置部分--------------------------------------
function cd_email_reg_config() {
    $config['swap_plug'] = '注册前邮箱验证';
    $config['swap_plug_version'] = '1.0';
    $config['swap_plug_explain'] = <<<SWAP
防止被刷注册
SWAP;
    $config['swap_plug_author'] = 'CcDalao';
    $config['swap_plug_website'] = 'http://blog.ccdalao.cn/';
    return $config;
}
//*****//
//CcDalao版权所有//
//*****//
//------------------------------------------------------------------------------------
function cd_email_reg() {
    $ccdalao_code = _POST('code');
    $nbip = plug_eva('reg_ccdalao_code','邮件码:'.$ccdalao_code);
    if (empty($nbip)) {
        exit(header('Location://'.$_SERVER['HTTP_HOST'].'/index.php/index/register/?error=验证码不正确或不存在'));
    }
    plug_eva('reg_ccdalao_code','邮件码:'.$ccdalao_code,NULL);  
}

add_swap_plug("注册判断","cd_email_reg");
